import java.util.*;

class people implements Comparable<people>{
    String ID;
    String birthday;
    public people(String ID){
        this.ID=ID;
        this.birthday=ID.substring(6,10)+"-"+ID.substring(10,12)+"-"+ID.substring(12,14);
    }

    @Override
    public int compareTo(people o) {
        return this.birthday.compareTo(o.birthday);
    }
}
class com implements Comparator<people>{
    @Override
    public int compare(people o1, people o2) {
        return o1.birthday.compareTo(o2.birthday);
    }
}



public class Test {
    public static void main(String[] args) {
        System.out.println(1/3==3/9);
    }
    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String ID;
        int sum=scanner.nextInt();
        scanner.nextLine();
        people[] peoples=new people[sum];
        for(int i=0;i<sum;i++){
            ID=scanner.nextLine();
            people people=new people(ID);
            peoples[i]=people;
        }
        Arrays.sort(peoples);
        while (scanner.hasNextLine()){
            String s1=scanner.nextLine();
            if(s1.equals("sort1")) {
                for (people x : peoples) {
                    System.out.println(x.birthday);
                }
            }
            if(s1.equals("sort2")){
                for(people x:peoples){
                    System.out.println(x.ID);
                }
            }
            if(s1.equals("e")){
                System.out.println("exit");
                break;
            }
        }
    }
    public static void main5(String[] args) {
        Scanner scanner=new Scanner(System.in);
        ArrayList<Integer> arrayList=new ArrayList<>();
        int det=scanner.nextInt();
        scanner.nextLine();
        String s;
        while (det>0){
            s=scanner.nextLine();
            String[] strings=s.split(" ");
            int a=(int)Integer.valueOf(strings[0]);
            int b=(int)Integer.valueOf(strings[2]);
            switch (strings[1]){
                case "mul":{arrayList.add(a*b);break;}
                case "div":{arrayList.add(a/b);break;}
                case "sub":{arrayList.add(a-b);break;}
                case "add":{arrayList.add(a+b);break;}
                default:arrayList.add(a%b);
            }
            det--;
        }
        for(int i=0;i<arrayList.size();i++){
            System.out.println(arrayList.get(i));
        }
        //System.out.println(Arrays.toString(arrayList.toArray()));
    }
    public static void main4(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s1=scanner.nextLine();
        String[] strings=s1.split(" ");
        Arrays.sort(strings);

//       for(int i=0;i<=strings.length-1;i++){
//            for(int j=i;j<=strings.length-2;j++){
//               int det=strings[j].compareTo(strings[j+1]);
//                if(det>=1&&det<24&&det>-26){
//                    String tmp=strings[j];
//                    strings[j]=strings[j+1];
//                    strings[j+1]=tmp;
//                }
//                if(det>26){
//                    String tmp=strings[j];
//                    strings[j]=strings[j+1];
//                    strings[j+1]=tmp;
//                }
//            }
//        }
        for(int i=0;i<strings.length;i++){
            if(i!=strings.length-1)System.out.print(strings[i]+" ");
            else System.out.print(strings[i]);
        }
    }
    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s1=scanner.nextLine();
        String s2=scanner.nextLine();
        int sum=0;
        int index=s1.length()-1;
        int det=0;
        while (index>=0){
            det=s1.lastIndexOf(s2,index);
            if(det!=-1){
                sum++;
                index=det-1;
            }
            else break;
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s=scanner.nextLine();
        char[] chars=s.toCharArray();
        int left=0;
        int right=chars.length-1;
        int det=1;
        while (left<=right){
            if(chars[left]!=chars[right]) {
                System.out.println("no");
                return;
            }
            left++;
            right--;
        }
        System.out.println("yes");
    }
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        List<Integer> list=new ArrayList<>();
        String s=scanner.nextLine();
        String p=scanner.nextLine();
        char[] chars1=s.toCharArray();
        char[] chars2=p.toCharArray();
        HashMap<Character,Integer> hashMap2=new HashMap<>();
        for(char x:chars2){
            hashMap2.put(x, hashMap2.getOrDefault(x,0)+1);
        }
        int left=0;
        int right=0;
        int sum=0;
        HashMap<Character,Integer> hashMap1=new HashMap<>();
        while (right<chars1.length){
            hashMap1.put(chars1[right], hashMap1.getOrDefault(chars1[right],0)+1);
            if(hashMap1.get(chars1[right])<=hashMap2.getOrDefault(chars1[right],0)) sum++;
            if(right-left+1>p.length()){
                if(hashMap1.get(chars1[left])<=hashMap2.getOrDefault(chars1[left],0)) sum--;
                hashMap1.put(chars1[left], hashMap1.get(chars1[left])-1);
                left++;
            }
            if(sum==p.length()) list.add(left);
            right++;
        }
        System.out.println(Arrays.toString(list.toArray()));
    }
}